#include "ORFilter.h"

using namespace analyzer;

ORFilter::ORFilter(boost::shared_ptr<AbstractFileFilter> filter1, boost::shared_ptr<AbstractFileFilter> filter2)
{
	filters.push_back(filter1);
	filters.push_back(filter2);
}


ORFilter::~ORFilter(void)
{
	// empty destructor
}

FileMatch ORFilter::acceptFile(std::string fileName) {

	FileMatch match;

	for(std::vector<boost::shared_ptr<AbstractFileFilter> >::iterator it = filters.begin(); it != filters.end(); ++it) {

		match = (*it) -> acceptFile(fileName);

		if(match.isMatched()) {

			return match;
		}
	}

	return FileMatch(false, UNKNOWN_FILE);
}